Conventionally, a server virtualization technique for operating a plurality of virtual servers called VMs (Virtual Machines) in a server as an information processing device is known.
FIG. 1 illustrates an outline of the server virtualization technique.
Software called VMM (Virtual Machine Monitor) 102 is operated in a server 101. The VMM 102 manages hardware resources for a memory, an IO (Input/Output) and the like of the server 101. Moreover, the VMM 102 emulates and provides each of VMs #0 to #2 with hardware resources needed by each of the VMs.
If a plurality of VMs are operated, an exclusive control for a memory is performed so that the plurality of VMs do not redundantly use a storage area of the same address in a physical memory included in the server 101. This exclusive control is performed with memory management of the VMM 102.
FIG. 2 illustrates an outline of the memory management performed by the VMM 102.
Memories respectively recognized by the VMs are called guest physical memories. These guest physical memories are grasped as continuous memory areas from the VMs. In contrast, the guest physical memories are grasped by the VMM 102 as separate memory spaces existing respectively for the VMs.
FIG. 2 illustrates the guest physical memories used when the two VMs #0 and #1 are operating in the VMM 102. In this case, there are two guest physical memories such as a guest physical memory #0 of the VM #0 and a guest physical memory #1 of the VM #1.
For example, an address X exists in each of the guest physical memories #0 and #1. If this address X is allocated to a real memory, namely, a host physical memory included in the server 101 unchanged, a memory contention occurs.
Therefore, the VMM 102 allocates the address X of the guest physical memory #0 to an address Z of the host physical memory, and also allocates the address X of the guest physical memory #1 to an address Y of the host physical memory. The VMM 102 allocates the host physical memory separately to the host physical memory in this way, thereby avoiding a memory contention.
Similar memory management is also needed when a VM executes a DMA (Direct Memory Access).
For example, a case where the VM #0 writes data to the address X of the guest physical memory #0 with a DMA transfer is considered. Writing data to a predetermined memory area with a DMA transfer is referred to as a DMA write. Moreover, a memory address that indicates a write destination of data with a DMA transfer is referred to as a DMA address.
In this case, if the VM #0 sets the address X as a DMA address in an IO adapter, a DMA write is made to the address X of the host physical memory. The address X of the host physical memory is a memory area unrelated to the address X of the guest physical memory #0. Therefore, memory corruption is caused. If the memory corruption is caused, the system panics, leading to a suspension of the system.
Accordingly, a DMA write by the VM #0 is made with the following procedures.
(1) The VM #0 requests the IO adapter to make a DM write to the address X of the guest physical memory #0.
(2) The VMM 102 traps the DMA write request made by the VM #0, and translates the address X of the guest physical memory #0 into an address W of a buffer area of the host physical memory. Then, the VMM 102 sets the translated address W in a DMA address setting register of the IO adapter.
(3) The VM #0 instructs the IO adapter to start the DMA.
(4) The IO adapter makes the DMA write to the address W.
(5) Upon completion of the DMA write, the IO adapter notifies the completion of the DMA write with a DMA completion interrupt.
(6) The VMM 102 copies data stored at the address W of the host physical memory to the address X of the guest physical memory #0.
(7) The VMM 102 notifies the VM #0 of the completion of the DMA write with a DMA completion interrupt.
(8) The VM #0 extracts the data from the address X of the guest physical memory #0.
One of the functions related to the server virtualization is a technique called live migration. Live migration is a technique for migrating a VM operating in one server to another without suspending an operation.
FIG. 3 illustrates an outline of live migration.
Live migration may be performed in an environment including two servers #0 and #1, a storage 320 shared by the servers #0 and #1, and a network 330 to which the servers #0 and #1 are connected. The live migration is performed with the following procedures.
(1) A VMM 311 operating in the migration destination server #1 prepares a VM 312.
(2) A migration source VMM 301 transfers the contents of a memory used by a migration source VM 302 to a migration destination VM 310 in a state in which the migration source VM 302 is operating. This process is called a pre-copying.
(3) The migration source VMM 301 suspends the operation of the migration source VM 302, and transfers the contents of the memory used by the migration source VM 302 to the migration destination VM 310. This process is referred to as a “stop-and-copy”.
(4) The migration destination VM 312 resumes the operation according to an instruction issued from the migration destination VMM 311.
As described above, the VMM performs all memory copying such as pre-copying, stop-and-copy, and the like. The reason the VMM may perform the memory copying is that the VMM manages the host physical memory.
The VMM mediates not only a write process from a CPU (Central Processing Unit) to the host physical memory but a DMA write, and detects a changed portion of memory/data of the migration source VM.
There is a technique called an IOMMU (Input/Output Memory Management Unit) as an IO virtualization technique. The IOMMU is a technique for speeding up a memory access by reducing an overhead of the memory access by the above described mediation of a VMM.
The IOMMU is a memory management unit, connected to an IO adapter and a host physical memory, for translating between a guest physical memory address and a host physical memory address.
By mounting the IOMMU, a DMA may be directly performed from an IO device to a guest physical memory of a VM as illustrated in FIG. 4. Use of this technique eliminates the need for the mediation of a VMM when an access is made to a guest physical memory with a DMA. This technique also eliminates the need for the VMM to make a data copy between the host physical memory and the guest physical memory.
However, use of the IOMMU eliminates the need for the mediation of VMM at a DMA access as described above. In this case, the VMM may not grasp an update of the guest physical memory performed with a DMA write. Therefore, the VMM may not properly make a memory copy. For this reason, measures are taken against this problem such as making the server equipped with the IOMMU illustrated in FIG. 4 hold changed content of the guest physical memory using a DMA write.
In relation to the above described technique, a method and a system are known for enabling a physical address space to be purged from a reference table used to reference a physical address from a guest to a host while some accesses, such as a DMA or the like, to the physical address are allowed to be made between virtual machines.
[Patent Document 1] Japanese Laid-open Patent Publication No. 2006-252554